package com.cq.hd.merchant.controller;

import com.cq.hd.common.annotation.MerchantLoginUser;
import com.cq.hd.common.entity.MerchantAppLoginUser;
import com.cq.hd.common.response.Result;
import com.cq.hd.member.api.TbMerchantAmtBillApi;
import com.cq.hd.member.api.dto.MerchantAmtBillDto;
import com.cq.hd.member.api.vo.MerchantAmtBillVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

import java.util.List;

@RestController
@RequestMapping("/merchantAmtBill")
@Api(tags = "商户资金明细相关接口")
public class MerchantAmtBillController {

    @Autowired
    private TbMerchantAmtBillApi merchantAmtBillApi;

    @ApiOperation(value = "商户资金流水")
    @ApiImplicitParam(name = "merchantAmtBillDto", value = "实体", paramType = "query", dataType = "MerchantAmtBillDto")
    @GetMapping("/list")
    public Result<List<MerchantAmtBillVo>> list(@ApiIgnore @MerchantLoginUser MerchantAppLoginUser merchantAppLoginUser, MerchantAmtBillDto merchantAmtBillDto) {
        merchantAmtBillDto.setMerchantId(merchantAppLoginUser.getMerchantId());
        return merchantAmtBillApi.listMerchantAmtBill(merchantAmtBillDto);
    }

}
